package com.twu.biblioteca;

public class Book {
    private int bookId;
    private String bookName;
    private String author;
    private String yearPublished;
    private int status = 0;

    protected Book(int bookId, String bookName, String author, String yearPublished) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.author = author;
        this.yearPublished = yearPublished;

    }

    public int getBookId() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getYearPublished() {
        return yearPublished;
    }

    public void setYearPublished(String yearPublished) {
        this.yearPublished = yearPublished;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        String temp = status == 0 ? "available" : "lended";
        return bookId + "        " + bookName + "      " + author + "       " + yearPublished + "       " + temp;
    }
}
